import axios from 'axios';

let base = '';

export const requestLogin = params => { return axios.post(`${base}/login`, params).then(res => res.data); };

export const getUserList = params => { return axios.get(`${base}/user/list`, { params: params }); };
export const getMaterielList = params => { return axios.get(`${base}/materiel/list`, { params: params }); };
export const getTreelList = params => { return axios.get(`${base}/tree/list`, { params: params }); };

export const getUserListPage = params => { return axios.get(`${base}/user/listpage`, { params: params }); };
export const getMaterielListPage = params => { return axios.get(`${base}/materiel/listpage`, { params: params }); };


export const removeUser = params => { return axios.get(`${base}/user/remove`, { params: params }); };
export const removeMateriel= params => { return axios.get(`${base}/materiel/remove`, { params: params }); };

export const editUser = params => { return axios.get(`${base}/user/edit`, { params: params }); };

export const addUser = params => { return axios.get(`${base}/user/add`, { params: params }); };
export const editMateriel = params => { return axios.get(`${base}/materiel/edit`, { params: params }); };

export const addMateriel = params => { return axios.get(`${base}/materiel/add`, { params: params }); };